﻿/****************************** Module Header ******************************\
 * Module Name:  ExMethodForDataTable.cs
 * Module Version:  1.0.0 (2012-10-27)
 * Copyright (c) AnyEB.Com (14507247@qq.com)
 * 
 * This class is used to extension collection instance's method.  It supplies 
 * useful extension methods, such as ToString(), FetchString() and so on.
 * 
 * This source is subject to the GPL License.
 * See http://www.gnu.org/licenses/gpl.html.
 * All other rights reserved.
 * 
 * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 
 * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED 
 * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
\***************************************************************************/
using System;

namespace UCF.Core
{
    public static class ExMethodForDateTime
    {
        public static int GetWeekOfYear(this DateTime dt)
        {
            int w = dt.DayOfYear / 7;
            if (dt.DayOfYear % 7 > 0) w += 1;
            return w;
        }
    }
}
